<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- lalalala -->
    <button id="creatService">创建服务器记录</button>
    <button id="getAllService">获取服务记录</button>
    <button id="getService">获取指定服务信息</button>
    <button id="updateService">更新服务器信息</button>

    <br>





</body>
<script>
    var ClientApi = require('../common/LocalDB');
    var $ = str => {
        return document.getElementById(str);
    };

    $('creatService').onclick = async () => {
        var service = await ClientApi.service.creatService({
            title: '99999',
            ip: '99999',
            username: '99999',
            password: '99999',
        });
        console.log(service);
    };

    $('getService').onclick = async () => {
        var service = await ClientApi.service.getService('65267d80-7a38-11ea-8d57-4192138b5d3d');
        console.log(service);
    };

    $('getAllService').onclick = async () => {
        var service = await ClientApi.service.getAllService();
        console.log(service);
    };

    $('updateService').onclick = async () => {
        var service = await ClientApi.service.updateService({
            serviceId: '65267d80-7a38-11ea-8d57-4192138b5d3d',
            title: '777',
            ip: '777',
            username: '777',
            password: '777',
        });
        console.log(service);
    };



</script>

</html>